#!/usr/bin/env python
#
#       Weapons.py
#       
#       Copyright 2009 Ben Davis <its.hip@gmail.com>, Pete Lord <mr.petelord@gmail.com>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

import os

import Effects
import Options

from Client import Client
client = Client()

# there's no superclass for weapons due to the individuality of them all, but for
# a basic example look at FrontCannon, when implemented.

class PawnCannonA():
    """ Diagonally forward firing on both sides. """
    def __setup__(self, parent):
        self.parent = parent # reference to the pawn/ship that owns the weapon.
        self.textures = client.ship_graphics[os.path.join("Data", "Weapons", "CannonA")]
        
    def fire(self):
        # show off the animations here.
        client.game.effects.add_higher(Effects.PawnCannonA(self.parent, self.textures))

class PawnCannonB():
    """ Firing to each side """
    def __setup__(self, parent):
        self.parent = parent # reference to the pawn/ship that owns the weapon.
        self.textures = client.ship_graphics[os.path.join("Data", "Weapons", "CannonB")]
                
    def fire(self):
        # show off the animations here.
        client.game.effects.add_higher(Effects.PawnCannonB(self.parent, self.textures))

        
class KingCannonS():
    """ Firing short-range at all compass points """
    def __setup__(self, parent):
        self.parent = parent # reference to the pawn/ship that owns the weapon.
        self.textures = client.ship_graphics[os.path.join("Data", "Weapons", "KingCannonS")]
                
    def fire(self):
        # show off the animations here.
        client.game.effects.add_higher(Effects.KingCannonS(self.parent, self.textures))
        
class KingCannonW():
    """ Water cannon forward to push enemies away, +damage """
    def __setup__(self, parent):
        self.parent = parent # reference to the pawn/ship that owns the weapon.
        self.textures = client.ship_graphics[os.path.join("Data", "Weapons", "CannonB")]
                
    def fire(self):
        # show off the animations here.
        client.game.effects.add_higher(Effects.KingCannonW(self.parent, self.textures))
